﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ListFiles.aspx.cs" Inherits="Manage_ListFiles" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <%
        if (Page.User.Identity.IsAuthenticated == false)
        {
            Response.Redirect("~/Manage/Default.aspx");
        }     
    %>

    <script type="text/javascript">
        function DeleteFile() {
            if (confirm("确认删除所选择的文件吗？")) {
                return true;
            } else {
                return false;
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:Label ID="UpFileLabel" runat="server" Text="上传新文件：" />
    <asp:FileUpload ID="UpFileControl" runat="server" Width="300px" />
    <asp:Button ID="UpFileButton" runat="server" onclick="UpFileButton_Click" 
        Text="上传" />
    <br />
    <asp:GridView ID="FileView" runat="server" BackColor="White" 
    BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
        AutoGenerateColumns="False">
    <Columns>
        <asp:TemplateField>
            <ItemStyle Width="80px" HorizontalAlign="Center"/>
            <ItemTemplate>
                <asp:LinkButton ID="DeleteButton" runat="server" Text="删除" OnCommand="Command_DeleteArticle" CommandArgument='<%#Eval("Name") %>' OnClientClick="return DeleteFile();" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Name" HeaderText="文件名">
        <ItemStyle Width="150px" />
        </asp:BoundField>
        <asp:BoundField DataField="Title" HeaderText="文件描述">
        <ItemStyle Width="200px" />
        </asp:BoundField>
        <asp:BoundField DataField="Created" HeaderText="创建时间">
        <ItemStyle Width="200px" HorizontalAlign="Center"/>
        </asp:BoundField>
    </Columns>
    <FooterStyle BackColor="White" ForeColor="#000066" />
    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
    <RowStyle ForeColor="#000066" />
    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#007DBB" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
</asp:Content>

